// 人员表单数据模型
import { powerStatus } from '@/components/ivew_conf/power/index'
import { formatDate } from '@/utils/tools'
 
class personalFormMod {


    public constructor(data?){

        if(data){
            Object.keys(data).forEach(key =>{

                if(this.hasOwnProperty(key)){
                    this[key] = data[key]
                }
                
            })
        }
      
    }

    id: string =''
    updateAt: string =''
    phone: string =''
    nickname: string =''
    password: string =''
    department: string =''
    company: string =''
    referee: string =''
    isCsjmobUser: boolean = true
    isMember: boolean = true
    isStaff: boolean = true
    isSales: boolean = true
    acl = new powerStatus()
    extensions = {

        member: {

            level: '黄金',
            referee: '',
            email: '',
            bankCardNumber: '',
            bankCardOwner: '',
            bank: ''
            
        },
        csjMobUser:{
            accountType: 0,
            expireDate: formatDate(),
            usageCount: 10
        },
        staff: {
            
            position: '',
            joinDate: formatDate(),
            idCardNumber: '',
            emergencyContactName: '', 
            emergencyContactPhone: '',
            address: '',
            bankCardNumber: '',
            bank: ''
            
        },
        sales: {
            
            signedCompany: '',
            salesId: '',
            contractId: '',
            bankCardNumber: '',
            bankCardOwner: '',
            bank: ''
            
        }

    }
    
    
}


export default personalFormMod


